package com.inda.lemurshooter;

import android.graphics.drawable.Drawable;

//Class describing the types of missions there are
public class Mission {
	
	public Mission(int toCaught, String animal, int extraTime) {
		this.n = toCaught;
		this.animal = animal;
		this.extraTime=extraTime*1000;
	}

	//Number of animals to catch
	private int n;
	
	//Number of animals already caught, default is zero
	private int nCaught;
	//name on animal to catch, "bird", "fish" or "lemur"
	private String animal;
	
	//Milliseconds to add to total game time success
	private int extraTime;
	
	//Image of animal needed
	private Drawable image;
	//Method to return if the caught animals are enough to succeed
	public boolean isDone(){
		if(n<=nCaught)
			return true;
		else 
			return false;
	}
	
	//Returns true if you caught the animal requested by the current mission
	public void catching(Animal aCaught){
		if(aCaught instanceof Bird && animal=="bird")
			nCaught++;
		else if(aCaught instanceof Fish && animal=="fish")
			nCaught++;
		else if(aCaught instanceof Lemur && animal=="lemur")
			nCaught++;
		else
			return;
	}

	public int getExtraTime() {
		return extraTime;
	}

	public int getN() {
		return n;
	}
	public void restart() {
		 nCaught=0;
	}
	public void setImage(Drawable d){
		image=d;
	}
	public String getAnimal() {
		return animal;
	}

	public Drawable getImage() {
		return image;
	}

	public int getNCaught() {
		return nCaught;
	}
}
